import java.util.Objects;

public abstract class Vehicle {
    private String brand;   //品牌
    private String plate_number;    //车牌号
    private double dayRent;    //租金
    public abstract double rentCalculation(int days);

    public Vehicle(String brand, String plate_number, double dayRent) {
        this.brand = brand;
        this.plate_number = plate_number;
        this.dayRent = dayRent;
    }

    public Vehicle() {
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getPlate_number() {
        return plate_number;
    }

    public void setPlate_number(String plate_number) {
        this.plate_number = plate_number;
    }


    public double getDayRent() {
        return dayRent;
    }

    public void setDayRent(double dayRent) {
        this.dayRent = dayRent;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Vehicle vehicle = (Vehicle) o;
        return Double.compare(vehicle.dayRent, dayRent) == 0 && Objects.equals(brand, vehicle.brand) && Objects.equals(plate_number, vehicle.plate_number);
    }

    @Override
    public int hashCode() {
        return Objects.hash(brand, plate_number, dayRent);
    }

    @Override
    public String toString() {
        return "Vehicle{" +
                "brand='" + brand + '\'' +
                ", plate_number='" + plate_number + '\'' +
                ", dayRent=" + dayRent +
                '}';
    }
}
